<template>
  <div>
    <div class="slideverify" v-show="isShowSlide" @mouseleave="hideSlide">
      <SlideVerify ref="slideblock" @success="sendSmsCode"></SlideVerify>
    </div>
  </div>
</template>

<script>
import SlideVerify from "./children/index.vue";
import { v4 as uuidv4 } from "uuid";
// setInterval(() => {
//   console.log(uuidv4()); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'
// }, 1);

export default {
  components: { SlideVerify },
  data() {
    return {
      isShowSlide: true,
    };
  },
  methods: {
    hideSlide() {
      //   setTimeout(() => {
      //     this.isShowSlide = false;
      //   }, 500);
    },
    sendSmsCode(times) {
      //此处的处理是：图片验证通过后，发送短信验证码，这个要根据具体情况单独处理
      //   setTimeout(() => {

      this.$message.success(
        `验证成功，验证时间:${(times / 1000).toFixed(1)}秒`
      );
      this.isShowSlide = false;
      //  this.$router.push('/')
      //   }, 500);
    },
  },
};
</script>
